<!DOCTYPE html>
<html>
<head>
<title>Product Detail</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/css/bootstrap.min.css" media="screen">
<link rel="stylesheet" href="/css/bootstrap-responsive.css">
<script src="/js/jquery-1.9.1.js"></script>
<script src="/js/bootstrap.js"></script>
<script src="/js/bootstrap.file-input.js"></script>
<script charset="utf-8" src="/js/kindeditor-min.js"></script>
<script charset="utf-8" src="/js/lang/en.js"></script>
<script charset="utf-8" src="/js/tp.js"></script>
<script charset="utf-8" src="/js/bootstrap-validation.js"></script>
</script>
<body>
	<form id="prodForm" class="form-horizontal" action="/adm/prod/save">
		<fieldset>
			<legend>Product Information</legend>
			<div class="control-group">
				{{with .product}}
				<label class="control-label" for="name">Name</label>
				<div class="controls">
					<input type="hidden" value="{{.ProductId}}" name="ProductId">
					<input type="text" class="input-xlarge" check-type="required" required-message="不能为空！" id="name" name="Name" value="{{.Name}}">
					<p class="help-block">A short name</p>
				</div>
				{{end}}
			</div>
			<div class="control-group">
				<label class="control-label" for="price">Price</label>
				<div class="controls">
					{{with .product}}
					<input  id="price" type="text" class="input-xlarge" name="Price" value="{{.Price}}">
					{{end}}
				</div>
			</div>
			<div class="control-group">
				<label class="control-label" for="catagory">Catagory</label>
				<div class="controls">
					<select name="Catagory">
						<option>1</option>
						<option>2</option>
						<option>3</option>
						<option>4</option>
						<option>5</option>
					</select>
				</div>
			</div>
			<div class="control-group">			
			<div class="controls addPic">
				<div class="row">				
				   <div class="span10" style="position:relative;left:-60px;top:0;padding-bottom:5px;border-bottom-width:1px;border-bottom-style:solid;margin-bottom:10px;"><strong>Bring your item to life with pictures</strong></div>
				   <div class="span2"></div>
				</div>			
			    <div class="row" style="margin-bottom:5px;">
				    <div class="span2">
						<input type="button" title="Add pictures" onkeydown="return false;"
						class="btn btn-success"	value="Add pictures" name="addPictures" id="addPicturesBtn">
					</div>
					<p class="ImageCount span4 offset4" id="imageCountTxt">Your pictures: <span id="imageCount">1</span> | 8 can be added</p>
				</div>
				<div class="picListDiv">
					<table cellspacing="0" cellpadding="0" border="0" summary="">
						<tbody>
							<tr id="pics_list">
							   {{range .pictures}}
									<td valign="top" style="">
										<div class="picSerialNumber"
											id="picnum_{{.Seq}}">
										</div>
										<div class="ImageSection">
											<div>
												<img border="0" align="middle" class="thumbnail"
													id="selImg{{.Seq}}" busi=""
													style="width: 98px; height: 98px" src="{{.Path}}" title="Photo"
													alt="Photo">
											</div>
										</div>
										<div id="selImgTitle{{.Seq}}"
											class="picselImgTitle">
											<span class="moveLeft"> <img border="0"
												src="/img/icon/iconInactMoveLt_16x16.gif" title="&nbsp;"
												alt="&nbsp;">
											</span><span class="moveRight"><img border="0"
												id="moveright0" src="/img/icon/iconInactMoveRt_16x16.gif"
												title="&nbsp;" alt="&nbsp;"> </span> <span
												class="removeImage"><img border="0"
												onclick="popWnd.init('uploadDiv', 'Upload Image');return false;"
												id="removeimage{{.Seq}}"
												style="cursor: pointer;"
												src="/img/icon/iconTrashcan_16x16.gif" title="Remove"
												alt="Remove"> </span>
										</div>
									</td>
									{{end}}
							</tr>
						</tbody>
					</table>
				</div>
			  </div>
			</div>
			<div class="control-group">
				<label for="description" class="control-label">Description</label>
				<div class="controls">
					{{with .product}}
					<textarea rows="4" id="textarea" name="Detail" value={{.Detail}}
						class="input-xlarge" style="width: 800px; height: 400px;">{{.Detail}}</textarea>
					{{end}}
				</div>
			</div>			
			<div class="form-actions">
				<button class="btn btn-primary" type="submit">Submit</button>
				<button id="canId" class="btn">Cancel</button>
			</div>
		</fieldset>
	</form>
  <div id="uploadPicModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
   <form class="form-horizontal" enctype="multipart/form-data" action="/adm/prod/upload" method="post" target="upfrm">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3>Upload a picture</h3>
	</div>
	<div class="modal-body">
        <div class="alert hide">
		  <strong>Warning:</strong><span>&nbsp;</span>
		</div>
		<div class="control-group">
			<label class="control-label" for="picAttachment">Select a picture</label>
			<div class="controls">
				{{with .product}}
				<input type="hidden" value="{{.ProductId}}" name="ProductId">
				{{end}}
				<input id="picAttachment" class="xlarge" type="file" name="uploadPic"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="picUrl">Picture link</label>
			<div class="controls">
			 <input type="text" value="uploaded link" onfocus="this.select();" class="xlarge" id="picUrl" name="link" size="30">
			</div>
	    </div>
	</div>
  <div class="modal-footer">
		<button type="submit" id="uploadBtn" class="btn btn-primary">Upload</button>
		<button class="btn btn-secondary" data-dismiss="modal" aria-hidden="true">Close</button>
  </div>
  </form>
  <iframe id="upfrm" name="upfrm" src="about:blank" style="width:0;height:0;display:none;border:0;" 
  frameborder='0'></iframe>
</div>
</body>
</html>